const fp = require('lodash/fp')
const { Maybe, Container } = require('./support')



// 1.实现 ex4 函数
let ex4 =  function(n){
    return Maybe.of(n).map(n => parseInt(n))
}
  
  // 2.测试打印
  console.log( ex4('7R') )   // Maybe { _value: 7 }
  console.log( ex4('7.6B'))  // Maybe { _value: 7 }
  console.log( ex4('8.2G') ) // Maybe { _value: 8 }
  
  console.log( ex4(null) )      // Maybe { _value: null }
  console.log( ex4(undefined) ) // Maybe { _value: undefined }
  
  console.log( ex4('i7.5') )    // Maybe { _value: NaN }
  console.log( ex4('abc') )     // Maybe { _value: NaN }
